colorAdminApp.controller('historicTaskInstanceController', function($scope,$cookieStore,$compile,$rootScope,$http,$state,$stateParams,modalService) {
	
	$scope.access_token=$cookieStore.get("access_token");
	
	$scope.easyNgPagination={
			options:{
				        currentPage:1,
				        totalCount:0,
				        pageSize:10,
			            onPageChange: function(){
			 		            	$scope.loadData();
			            }
			}
	};
	
	$scope.items=[];

	$scope.loadData=function(){
		var currentPage=$scope.easyNgPagination.options.currentPage-1;
		var entity={"page":currentPage,"size":$scope.easyNgPagination.options.pageSize};
		entity["processInstanceId"]=$stateParams.processInstanceId;
        $(".dataTables_wrapper").block({ message:'正在加载数据，请稍等...',css: { top: '50%' } });
		$http.post('api/workflow/process/task/findHistoricTaskInstanceByPage',{params:entity}).success(function(data, status, headers, config) {
			$scope.items=data.data.content;
			$scope.easyNgPagination.options.totalCount=data.data.totalElements;
			$(".dataTables_wrapper").unblock();
		}).error(function(data, status, headers, config) {
	    	
        });  
	};
	
   $scope.goBack=function(){
	   
	    var stateCode="main.WORKFLOW_PROCESS_INSTANCE_MANAGE";
		
		//跳转页面，并传递流程定义ID
		$state.go(stateCode,{});	
   }
    
	
});
